package com.atguigu.gmall.controller;

import com.atguigu.gmall.client.service.OrderFeignClientService;
import com.atguigu.gmall.entity.OrderInfo;
import com.atguigu.gmall.result.RetVal;
import com.atguigu.gmall.util.AuthContextHolder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

@Controller
public class WebOrderController {
    @Autowired
    private OrderFeignClientService orderFeignClientService;

    @GetMapping("confirm.html")
    public String trade(Model model){
        RetVal<Map<String, Object>> retVal = orderFeignClientService.confirm();
        model.addAllAttributes(retVal.getData());
        return "order/confirm";
    }

    @GetMapping("myOrder.html")
    public String toMyOrder(){
        return "order/myOrder";
    }
}
